﻿using System;
using System.Collections.Generic;
using System.Data;
using Dapper;
using ZilLion.Service.Crm.CommonRepository;
using ZilLion.Service.Crm.ModelBase.EntityBase.Identity;
using ZilLion.Service.WechatService.Domain.WebApiRepository.InterFace;
using AccThrOpenYwcore = ZilLion.Service.Crm.CommonEntity.AccOpr.Web.AccThrOpenYwcore;

namespace ZilLion.Service.WechatService.Domain.WebApiRepository
{
    public class RegesiterRepository : CrmSqlServerRespository<AccThrOpenYwcore>, IRegesiterRepository
    {
        public RegesiterRepository(long? accid) : base(accid)
        {
        }

        public ResponseResultInfo SimpleRegesiter(AccThrOpenYwcore info, string oprpj)
        {
            DynamicParameters p = CreateDynamicParameters();
            List<Action<IDbConnection>> paActions = new List<Action<IDbConnection>>();
            var ywInfoparam= ExecuteProcAddParam(info, "#ywcore", true);
            paActions.Add(ywInfoparam);
            ExecuteProc(paActions, "pr_AccThrOpen_submit_new", p, null);
            return ReturnResponseResultInfo<ResponseResultInfo>(p) ?? new ResponseResultInfo();
        }
    }
}
